class Animal:
    def __init__(self,name,age):
        self.name = name
        self.age =age
    def eat(self):
        print(f'{self.name} can eat')
    def sleep(self):
        print(f'{self.name} can sleep')
    def jiao(self):
        print(f'{self.name} 能叫')

class Dog(Animal):
    def __init__(self,name,age):
        super().__init__(name,age)
    # 覆盖式重写(override)父类中的jiao方法
    def jiao(self):
        print(f'{self.name} 能嗷嗷叫')

class Cat(Animal):
    def __init__(self,name,age):
        super().__init__(name,age)
        # 扩展式重写
    def jiao(self):
        super().jiao()
        print(f'{self.name} 会喵喵叫' )

ani=Animal('ani',3)
dog=Dog('dog',4)
cat=Cat('kitty',2)

ani.jiao()
dog.jiao()
cat.jiao()

